#ifndef _DEV_TCPCLIENT_H_
#define _DEV_TCPCLIENT_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <types.h>
#include "device.h"
#include "netcore.h"

#define REMOTE_PARA_CNT 2
struct tcp_client_cfg
{
    const char *ethname;
    ip_addr_t   local_ip;
    ip_addr_t   remote_ip[REMOTE_PARA_CNT];
    u16         local_port;
    u16         remote_port[REMOTE_PARA_CNT];

    bool        autoconn;
    u16         conn_timeout;                  /* unit: second                */
    u16         eth_chk_timeout;               /* unit: second, 0: disable    */
};

int tcp_client_dev_add(const char *name, const struct tcp_client_cfg *cfg);
void tcp_client_del(device_t *dev);

#ifdef __cplusplus
}
#endif
#endif
